package com.aplink.generic.util.objectrule;

import java.io.Serializable;

import com.aplink.generic.pojo.GenericObject;

public class TargetRule implements Serializable {
    private static final long serialVersionUID = -541948540147339659L;
    private ActionBaseRule actionBaseRule;
    private String targetActivity;

    public TargetRule() {
        this.targetActivity = "";
        this.actionBaseRule = null;
    }

    public TargetRule(final String _targetActivity,
            final ActionBaseRule _actionBaseRule) {

        this.targetActivity = _targetActivity;
        this.actionBaseRule = _actionBaseRule;
    }

    public ActionBaseRule getActionBaseRule() {
        return this.actionBaseRule;
    }

    public String getTargetActivity() {
        return this.targetActivity;
    }

    public boolean isSatisfiedCondition(final GenericObject genericObject) {
        boolean isSatisfied = false;
        if (genericObject != null) {
            isSatisfied = this.actionBaseRule
                    .isSatisfiedActionRule(genericObject);
        }
        return isSatisfied;
    }

    public void setActionBaseRule(final ActionBaseRule actionBaseRule) {
        this.actionBaseRule = actionBaseRule;
    }

    public void setTargetActivity(final String targetActivity) {
        this.targetActivity = targetActivity;
    }

}
